package top.college.jjb;

import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.JButton;
import top.college.model.ProfessorVO;
import java.awt.FlowLayout;
import javax.swing.ScrollPaneConstants;

// 수강내역
public class register extends JPanel {
	private JTable table;
	

	/**
	 * Create the panel.
	 */
	public register() {
		table();
		panel();
	}
private void table(){
	ProfessorVO p = new ProfessorVO();
	setLayout(new BorderLayout(0, 0));
	
	table = new JTable();
	table.setModel(new DefaultTableModel(
	new Object  [][] {
			{"","","","","",null},
					
					
		
		},
		new String[] {
			"과목명","담당교수","과목구분","교과목소개","학점","신청"
		}
	) {
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;
		Class[] columnTypes = new Class[] {
			Object.class, Object.class, Object.class, Object.class, Object.class, Boolean.class
		};
		public Class getColumnClass(int c) {
			return columnTypes[c];
		}
	});
	JScrollPane scrollPane = new JScrollPane(table);
	scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
	add(scrollPane);
	table.setPreferredSize(new Dimension(400, 250));
	
	
	
}
private void panel(){
	JPanel panel_1 = new JPanel();
	panel_1.setPreferredSize(new Dimension(10, 30));
	add(panel_1, BorderLayout.SOUTH);
	panel_1.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
	
	JButton btnNewButton = new JButton("수강신청");
	panel_1.add(btnNewButton);
}
}
